﻿@page "/routelist"
@using Microsoft.Extensions.Configuration
@using BootstrapBlazorApp.Model.Entity
@using System.Net.Http.Json
@using Newtonsoft.Json
@using Newtonsoft.Json.Linq


<h3>RouteList</h3>

<Table TItem="ProxyRoute" IsPagination="true" Items="list"
       UseInjectDataService="true"
       IsStriped="true" IsBordered="true" ShowSkeleton="true" IsMultipleSelect="true"
       ShowToolbar="true" ShowSearch="true" ShowExtendButtons="true"
       AutoGenerateColumns="true" EditMode="EditMode.Popup">
    <TableColumns>
        <TableColumn @bind-Field="@context.Id" />
        <TableColumn @bind-Field="@context.AuthorizationPolicy" />
        <TableColumn @bind-Field="@context.ClusterId" />
        <TableColumn @bind-Field="@context.CorsPolicy" />
    </TableColumns>
    <EditTemplate>
        <div class="row">
            <p>基本信息</p>
            <div></div>
            <div class="form-group col-12 col-sm-6">
                <BootstrapInput @bind-Value="@context.RouteId" placeholder="请输入名称" maxlength="50">
                    <RequiredValidator />
                    <StringLengthValidator Length="50" />
                </BootstrapInput>
                <BootstrapInput @bind-Value="@context.ClusterId" placeholder="请选择集群" maxlength="50">
                    <RequiredValidator />
                    <StringLengthValidator Length="50" />
                </BootstrapInput>
                <BootstrapInput @bind-Value="@context.RouteId" placeholder="请输入顺序" maxlength="50">
                    <RequiredValidator />
                    <StringLengthValidator Length="50" />
                </BootstrapInput>
                <BootstrapInput @bind-Value="@context.CorsPolicy" placeholder="请输入Cors策略" maxlength="50">
                    <RequiredValidator />
                    <StringLengthValidator Length="50" />
                </BootstrapInput>
                <BootstrapInput @bind-Value="@context.AuthorizationPolicy" placeholder="请输入授权策略[" maxlength="50">
                    <RequiredValidator />
                    <StringLengthValidator Length="50" />
                </BootstrapInput>
            </div>
            <p>匹配规则</p> <div></div>
            if(@context.Match == null) @context.Match =new  ProxyRoute();
            <BootstrapInput @bind-Value="@context.Match.Hosts" placeholder="请输入主机[" maxlength="50">
            </BootstrapInput>
              
              
           
               
                        <CheckboxList @bind-Value="@context.Match.Methods" Items="@MethodList" />
             
      
               
            <div class="form-group col-12 col-sm-6">
                @*<Select Items="Items3"   @bind-Value="@context.LoadBalancingPolicy"></Select>*@
            </div>
            <p>转换配置</p> <div></div>
        </div>
    </EditTemplate>

</Table>


